<?php
namespace app\admin\controller;

use think\Controller;
use think\Session;

/**
 * Class Base
 * @package app\admin\controller
 */
class Base extends Controller{
    protected $config = array();
	function __construct(){
		//继承运行父类模板
		parent::__construct();
		# code...
	}

    /**
     * 判断是否登录
     */
	public function isLogin(){
	    if(!Session::has('username')){
            $this->error('非法登录','admin/Login/index','','1');
        }
        $this->config['username'] = Session::get('username');
	    $this->config['remark'] = Session::get('remark');
	    $this->config['user_id'] = Session::get('user_id');
    }
}

